//
//  WebViewProgressLine.m
//  ZiJinLian
//
//  Created by 震霄 张 on 2018/3/18.
//  Copyright © 2018年 lzy. All rights reserved.
//

#import "WebViewProgressLine.h"

@implementation WebViewProgressLine

-(instancetype)initWithFrame:(CGRect)frame{
	self = [super initWithFrame:frame];
	if (self) {
		self.hidden = YES;
		self.backgroundColor = [UIColor whiteColor];
	}
	return self;
}

-(void)setLineColor:(UIColor *)lineColor{
	_lineColor = lineColor;
	self.backgroundColor = lineColor;
}

-(void)startLoadingAnimation{
	self.hidden = NO;
	self.mj_w = 0.0;
	
	__weak UIView *weakSelf = self;
	[UIView animateWithDuration:0.4 animations:^{
//		weakSelf.mj_w = MainW * 0.6;
		[weakSelf setMj_w:MainW*0.6];
	} completion:^(BOOL finished) {
		[UIView animateWithDuration:0.4 animations:^{
//			weakSelf.mj_w = MainW * 0.8;
			[weakSelf setMj_w:MainW *0.8];
		}];
	}];
	
	
}

-(void)endLoadingAnimation{
	__weak UIView *weakSelf = self;
	[UIView animateWithDuration:0.2 animations:^{
//		weakSelf.mj_w = MainW;
		[weakSelf setMj_w:MainW];
	} completion:^(BOOL finished) {
		weakSelf.hidden = YES;
	}];
}

@end
